<template>
  <el-container>
    <el-main>
      <venus-form
        :venus-form-items="venusFormItems.modifyFormItems"
        :parms-value="parmsValue.modifyParmsValue"
      />
    </el-main>
  </el-container>
</template>

<script>
  import { formFuncs, formItems } from '@/utils/formItems'
  import Vue from 'vue'

  export default {
    props: {
      editMod: {
        type: String,
        default: 'ADD'
      }
    },
    data() {
      return {
        dict: Vue.filter('dict'),
        parmsValue: {
          // 增删改字段值
          modifyParmsValue: {
            name: '',
            code: ''
          },
          addParmsValue: {

          }
        },
        venusFormItems: {
          // 删改字段
          modifyFormItems: [
            formFuncs.withProperty(formItems.operMod, formItems.REQUIRE),
            formFuncs.withProperty(formItems.collMod, formItems.REQUIRE),
            formFuncs.withProperty(formItems.busiMod, formItems.REQUIRE),
            formFuncs.withProperty(formItems.safeRate, formItems.REQUIRE),
            formFuncs.withProperty(formItems.safeCapit, formItems.REQUIRE),
            formFuncs.withProperty(formItems.termFlag, formItems.REQUIRE),
            formFuncs.withProperty(formItems.redeemFlag, formItems.REQUIRE),
            formItems.bordTrustiCode,
            formItems.bordTrustiName,
            formItems.oversTrustiNation,
            formItems.oversTrustiName
          ],
          // 新增字段
          addFormItems: [
          ]
        }
      }
    },
    // 生命周期开始
    beforeMount() {
      if (this.editMod === formItems.DETAIL) {
        this.venusFormItems.modifyFormItems = formFuncs.handleDetailItem(this.venusFormItems.modifyFormItems, '产品报备数据')
      }
    },
    // 生命周期结束
    methods: {
      currentChange() {

      }
    }
  }
</script>
